Repository navigation
nixos/home: fold script-installed laptop units into the flake (code#3720) - #3722
Conversation
…720) One home-manager module per system, enabled from nixos/hosts/default.nix next to the existing laptop modules, replicating the installed units' semantics exactly (ExecStart, WorkingDirectory, timer schedules, timeouts, Nice); executed scripts stay at their checkout paths per the fleet-feed-collector precedent — only unit provenance changes. Systems: github-backup (drain/fetch/reconcile), worktree-reaper, cloudflare-quota-export, meta-quota-export, dashboard-backup, oc-password-sync. One intentional difference: worktree-reaper's ExecStart moves from the pre-merge bootstrap worktree (~/git/code-wt-reaper) to the canonical primary path (~/git/code/infra/worktree-reaper), retiring the bootstrap install per the reaper README; this therefore lands after #3698 merges.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 29 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 78b4fc0ca5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| }; | ||
| Service = { | ||
| Type = "oneshot"; | ||
| ExecStart = "/usr/bin/env python3 ${home}/git/code/infra/worktree-reaper/bin/worktree_reaper.py"; |
There was a problem hiding this comment.
Merge the reaper implementation before switching its path
On a primary checkout of this commit, the newly enabled service invokes a script that does not exist: the target commit's recursive Git tree and repository-wide searches contain no infra/worktree-reaper implementation or generator supplying it. Consequently, each hourly run exits with Python's file-not-found error instead of retiring worktrees. The commit message acknowledges the dependency on #3698, but that prerequisite is not present in the reviewed tree; merge it before landing this change, or retain the bootstrap execution path until then.
Useful? React with 👍 / 👎.
Equivalence check (pre-activation)The
Also verified: A full toplevel Activation stateStaged, not switched. The switch requires Drew's interactive sudo password ( |
Live census correction: the oc-password-sync system is two units, not one. oc-password-sync.path (also a plain file) watches the prod OpenCode service file and triggers the service; it is the unit actually enabled into default.target. The .service's own [Install] is dormant. Both are now declared in nixos/home/oc-password-sync.nix, replicating the installed files exactly.
Scope correction + final state16 unit files, not 15. Live verification found a unit the original census missed: Found while verifying (pre-existing, not a fold regression): Build note: repeated full-toplevel Activation remains staged on Drew's interactive sudo (move + |
File-level equivalence — confirmed for the built treeThe full toplevel
The 16th unit, |
Equivalence closed: 16/16 at file levelThe confirmation build of the branch tip ( Final tally for the whole fold, all at generated-file level: 15/16 units identical in every field; worktree-reaper.service differs only in the intentional ExecStart move (bootstrap worktree → primary checkout). Nothing about the activation state changes: still staged on the move + |
Refs #3720. Drew ordered 2026-11-01 ("fix all now").
What
One home-manager module per script-installed laptop system, enabled from
nixos/hosts/default.nixnext to the existing laptop modules:nixos/home/github-backup.nixnixos/home/worktree-reaper.nixnixos/home/cloudflare-quota-export.nixnixos/home/meta-quota-export.nixnixos/home/dashboard-backup.nixnixos/home/oc-password-sync.nixSemantics replicate the installed plain-file units exactly (ExecStart, WorkingDirectory, timer schedules, Persistent/RandomizedDelaySec, TimeoutStartSec, Nice, enablement). Executed scripts stay at their checkout paths per the fleet-feed-collector precedent — only unit provenance changes. The github-backup drainer's Bitwarden access stays inside its wrapper script; the units carry no environment of their own, as today.
Intentional difference (one)
worktree-reaper's ExecStart moves from the pre-merge bootstrap worktree~/git/code-wt-reaper/infra/worktree-reaper/...to the canonical primary path~/git/code/infra/worktree-reaper/..., retiring the bootstrap install per the reaper README (absorbs the #3698 post-merge tail). This PR therefore lands after #3698 merges — before that, the primary path does not exist.Equivalence + activation
amdconfiguration is built from this branch on the laptop and the generated units are diffed field-by-field against the installed files (results in a follow-up comment).~/.local/state/flake-fold-backup-2026-11-01/on the laptop (rollback = restore them), then the established~/run-switch.shpath runs; each migrated unit is verified to resolve into /nix/store with its timer armed, plus one functional run per system.Not in scope: rustdesk.service (vendor), git-maintenance@ (git's own), oc-sumauto (transient, no file).
Need help on this PR? Tag
@codesmith-botwith what you need.